#include "Complex.h"
#include<iostream>
using namespace std;
 Complex::Complex(){
	
}
Complex::Complex(double d,double i){
	_real=d;
	_image=i;
}
Complex::~Complex(){
	
}
Complex&Complex::operator=(const Complex& c){
	if(this!=&c){
		_real=c._real;
		_image=c._image;
	}
	return*this;
}
Complex Complex::operator+(const Complex&c) const{
	return Complex(_real +c._real, _image +c._image);
}
Complex Complex::operator+=(const Complex&c){
	_real+=c._real;
	_image+=c._image;
	return *this;
	}
bool Complex::operator==(const Complex& c)const{
	return(_real==c._real)&&(_image==c._image);
}
double Complex::getReal(){
	return _real;
}
void Complex::setReal(double d){
	_real=d;
}
double Complex::getImage(){
	return _image;
}
void Complex::setImage(double i){
	_image=i;
}
ostream& operator<<(ostream& os, Complex& c){
	os<<"real's value is: "<<c._real<<" ;image's value is: "<<c._image<<endl;
	return os;	
}
istream& operator>>(istream& is, Complex& c){
	is>>c._real>>c._image;
	return is;
}
